package com.example.demo.printutil;

import java.io.IOException;

/**
 * 纸宽58mm的打印机
 * Created by liuguirong on 8/1/17
 */
@SuppressWarnings("unused")
public class PrinterWriter55mm extends PrinterWriter {

    public static final int TYPE_55 = 55;// 纸宽58mm
    public int width = 360;

    public PrinterWriter55mm() throws IOException {
    }

    public PrinterWriter55mm(int parting) throws IOException {
        super(parting);
    }

    public PrinterWriter55mm(int parting, int width) throws IOException {
        super(parting);
        this.width = width;
    }

    @Override
    protected int getLineWidth() {
        return 15;
    }

    @Override
    protected int getLineStringWidth(int textSize) {
        switch (textSize) {
            default:
            case 0:
                return 30;
            case 1:
                return 14;
        }
    }

    @Override
    protected int getDrawableMaxWidth() {
        return width;
    }
}
